<!-- 同步规则 -->
<template>
  <div class="dashboard-editor-container">
    <el-row style="background: #fff; padding: 16px 16px;">
        <keep-alive>
            <el-tabs v-model="activeName" type="border-card" @tab-click="handleClick">
                <el-tab-pane label="报表规则" name="rules"><rules v-if="activeName === 'rules'" ></rules></el-tab-pane>
                <el-tab-pane label="历史报表" name="history"><history v-if="activeName === 'history'" ></history></el-tab-pane>
                <!-- <el-tab-pane label="报表参数" name="parameter"><parameter v-if="activeName === 'parameter'" ></parameter></el-tab-pane> -->
            </el-tabs>
        </keep-alive>
    </el-row>
  </div>
</template>

<script>
import rules from './rules.vue'
import history from './history.vue'
import parameter from './parameter.vue'
export default {
    components:{
        rules,
        history,
        parameter
    },
    data(){
        return{
            activeName:'rules'
        }
    },
    created(){
        if (sessionStorage.getItem('rules_names') == null) {
            this.activeName = 'rules'
        } else {
            this.activeName = sessionStorage.getItem('rules_names')
        }
    },
    methods:{
        handleClick (tab, event) {
            sessionStorage.setItem('rules_names', tab.name)
        }
    }
}
</script>

<style scoped lang='scss'>
/* @import url(); 引入css类 */
.top{
  display:flex;
  justify-content:space-between;
  align-items: center;
}
// /* cascader 隐藏单选样式 start */
// 	::v-deep .cascader .el-cascader-panel .el-radio {
// 		display: none !important;
// 	}
</style>
<style>
.el-cascader-panel .el-radio {
  display: none;
}
</style>
